package com.seele.tigerwallet.api;

import com.google.gson.Gson;
import com.google.gson.JsonElement;
import com.seele.tigerwallet.ui.utils.GsonUtil;

import java.util.List;

public abstract class APIListCallBack<T> extends APICallBack<T> {


    @Override
    protected void onArrayResponse(JsonElement jsonElement) {

        List<T> response = GsonUtil.jsonToArrayList(jsonElement, getType());
        onResponse(response);

    }

    protected abstract void onResponse(List<T> response);
}
